<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:include="teacher/common :: commonhead">
    <!--<div th:replace="teacher/common :: commonhead"></div>-->
</head>
<head>
    <title>添加课程</title>
    <!--这里写这个页面单独需要的css-->
</head>
<body class="sticky-header">

<section>
    <!--  引入左侧边  -->
    <div th:replace="teacher/common :: left"></div>

    <div class="main-content">
        <div th:replace="teacher/common :: header-section"></div>
        <!--这里开始写东西-->

        <div class="row">
            <section class="panel col-lg-8 col-md-offset-2">
                <header class="panel-heading">
                    信息管理
                </header>
                <div class="panel-body">
                    <form class="form-horizontal adminex-form" th:action="@{/teacher/addCourse}" method="post" onsubmit="return check()">
                        <input type="hidden" th:value="${teacher.teaId}" name="teaId">
                        <input type="hidden" th:value="${teacher.teaName}" name="teaName">
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">课程名</label>
                            <div class="col-md-4">
                                <input type="text"class="form-control" name="couName">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">学年</label>
                            <div class="col-md-4">
                                <input type="month" class="form-control" name="couStart" id="beginDate">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">至</label> <br>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">学年</label>
                            <div class="col-md-4">
                                <input type="month" class="form-control" name="couEnd" id="endDate">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-lg-offset-3 col-lg-10">
                                <button class="btn btn-primary" type="submit">添加</button>
                            </div>
                        </div>
                    </form>
                </div>
            </section>
        </div>

    </div>
</section>

<div th:replace="teacher/common :: commonjs"></div>
<!--<script type="text/javascript" th:href="@{/js/bootstrap-datepicker/js/bootstrap-datepicker.js}"></script>
<script type="text/javascript" th:href="@{/js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js}"></script>
<script type="text/javascript" th:href="@{/js/bootstrap-daterangepicker/moment.min.js}"></script>
<script type="text/javascript" th:href="@{/js/bootstrap-daterangepicker/daterangepicker.js}"></script>
<script type="text/javascript" th:href="@{/js/bootstrap-colorpicker/js/bootstrap-colorpicker.js}"></script>
<script type="text/javascript" th:href="@{/js/bootstrap-timepicker/js/bootstrap-timepicker.js}"></script>
<script type="text/javascript" th:href="@{/js/pickers-init.js}"></script>-->

<script>
    function check() {
        var beginDate = $("#beginDate").val();
        var endDate = $("#endDate").val();
        var d1 = new Date(beginDate.replace(/\-/g, "\/"));
        var d2 = new Date(endDate.replace(/\-/g, "\/"));
        if (beginDate != "" && endDate != "" && d1 >= d2) {
            alert("开始时间不能大于结束时间！");
            return false;
        }
        return true;
    }
</script>
</body>
</html>